/*
 * 刷新验证码
 */
function changeCapImg() {
    $("#captchaImg").attr("src", captchaUrl + "&rand=" + Math.random());
}

function checkFrm() {

}
var optionTmp = {
    type: "post",
    dataType: "json",
    beforeSubmit: checkFrm,
    url: ajaxLoginUrl,
    success: function (data) {
        if (data.flag) {
            window.location.href = data.adminIndexUrl;
        } else {
            dialog.msg(data.msg);
        }
    }
};
$("#loginFrm").ajaxForm(optionTmp);

//$("#login").click(function(){
//    $("#loginFrm").ajaxSubmit(optionTmp);
//});
$("#username,#password").keypress(function (e) {
    if (e.keyCode == '13') {
        $("#loginFrm").ajaxSubmit(optionTmp);
    }
});

